package com.climber.spb_rabbitmq.spb_confirm.service;

import com.climber.spb_rabbitmq.spb_confirm.config.RabbitMQConfigConfirm;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MessageReceiver {

    @RabbitListener(queues = RabbitMQConfigConfirm.CONFIRM_QUEUE_NAME)
    public void receiveMsg(Message message){
        String msg=new String(message.getBody());
        System.out.printf("接受到队列 confirm.queue 消息:%s\n",msg);
    }
}
